package com.xnyzc.lhy.common.penum.order;

/**
 * 订单号开头分类
 * zhuyubin
 */
public enum EOrderNoType {

    ZFJC("自费叫车", "ZFJC"),
    GRGW("个人公务", "GRGW"),
    BMGW("部门公务", "BMGW"),
    SPGW("审批公务", "SPGW"),
    TEGR("个人提额", "TEGR"),
    TEGW("公务提额", "TEGW"),
    CZYE("充值余额", "CZYE");

    private String desc;
    private String type;

    EOrderNoType(String desc, String type) {
        this.desc = desc;
        this.type = type;
    }

    public static EOrderNoType findById(String type) {
        EOrderNoType eOrderNoType;
        switch (type) {
            case "ZFJC":
                eOrderNoType = EOrderNoType.ZFJC;
                break;
            case "GRGW":
                eOrderNoType = EOrderNoType.GRGW;
                break;
            case "BMGW":
                eOrderNoType = EOrderNoType.BMGW;
                break;
            case "SPGW":
                eOrderNoType = EOrderNoType.SPGW;
                break;
            case "TEGR":
                eOrderNoType = EOrderNoType.TEGR;
                break;
            case "TEGW":
                eOrderNoType = EOrderNoType.TEGW;
                break;
            case "CZYE":
                eOrderNoType = EOrderNoType.CZYE;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eOrderNoType;
    }

    public String getType() {
        return this.type;
    }

    public String getDesc() {
        return this.desc;
    }
}
